# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname="autorandr"
pkgver=1.12.1
pkgrel=1
pkgdesc="Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr"
url="https://github.com/phillipberndt/autorandr"
arch="all"
license="GPL-3.0"
depends="
	python3
	py3-packaging
	xdpyinfo
	xrandr
"
makedepends="
	py3-setuptools_scm
	libxcb-dev
	bash-completion
"
source="$pkgname-$pkgver.tar.gz::https://github.com/phillipberndt/autorandr/archive/$pkgver.tar.gz"
options="!check"
builddir="$srcdir/$pkgname-$pkgver"
subpackages="
	$pkgname-udev
	$pkgname-doc
	$pkgname-launcher
	$pkgname-bash-completion
"

package() {
	make DESTDIR="$pkgdir" \
		UDEV_RULES_DIR="/etc/udev/rules.d" install_udev \
		install_manpage \
		install_bash_completion \
		install_launcher \
		install_autorandr
}

udev() {
	install_if="$pkgname udev"
	amove etc/udev/rules.d/
}

launcher() {
	amove usr/bin/autorandr-launcher
	amove etc/xdg/autostart/autorandr-launcher.desktop
}

sha512sums="
a7e095eb96e7e0d3a5b3b2122d68a3d3a5121d8be7a86ddd9f837ad42b7a53ed5ee45151f23861c5b900e214a4dfc0c575f45fe70c8c5587562a4035458137a0  autorandr-1.12.1.tar.gz
"
